<div class="pull-right">
<%= link_to "Add a job", new_admin_job_path, class: "btn btn-primary" %>
</div>
<br><br>

<table class="table">
  <thead>
    <tr>
      <th>#</th>
      <th>Title</th>
      <th>Received Resumes</th>
      <th>Is Hidden</th>
      <th>Options</th>
      <th>Create Date</th>
    </tr>
  </thead>
  <tbody>
    <% @jobs.each do |job| %>
    <tr>
      <td><%= job.id %> </td>
      <td>
      <%= render_job_status job %>
      <%= job.title %>
      </td>
      <td><%= job.resumes.count %></td>
      <td> <%= link_to job.resumes.count, admin_job_resumes_path(job) %> </td>
      <td>
      <%= link_to "Edit", edit_admin_job_path(job), class: "btn btn-xs btn-default" %>
      <%= link_to "Delete", admin_job_path(job), method: :delete,
        data: {confirm: "are you sure?"} , class: "btn btn-xs btn-default" %>

      <% if job.is_hidden %>
        <%= link_to "Publish", publish_admin_job_path(job), :method => :post, class: "btn btn-xs btn-default" %>
      <% else %>
        <%= link_to "Hide", hide_admin_job_path(job), method: :post, class: "btn btn-xs btn-default" %>
      <% end %>
      </td>
      <td><%= job.created_at %></td>
    </tr>
    <% end %>
  </tbody>
</table>
